 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<meta http-equiv="Cache-Control" content="No-Cache">
	<meta http-equiv="Pragma" content="No-Cache">

	<title>운세의 신</title>

	<link rel="stylesheet" type="text/css" href="/css/common.css">
	<link rel="stylesheet" type="text/css" href="/css/sub.css">
	<link rel="stylesheet" type="text/css" href="/css/mypage.css">

	<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
	<script src="/js/utility/common_util.js" type="text/javascript"></script>
	<script src="/js/snsLinker.js" type="text/javascript"></script>
	<script type="text/javascript">
		function openResultHtml(result_html_url) {
			openPopup(result_html_url,800,1000);
		}
		
		function hideServiceHistory(idx) {
			if (confirm("삭제 하시면 다시보기 기능이 제공되지 않습니다.")) {
				location.href = "/mypage/service_history/hide_service_history?idx="+idx;
			}
		}
	</script>
</head>
<body>
<div id="wrap">
	<!-- Header -->
	<? include_once $_SERVER['DOCUMENT_ROOT'].'/include/commons/main_header.php'; ?>
	<!--// Header -->

	<!--커튼 데코레이션-->
	<? include_once $_SERVER['DOCUMENT_ROOT'].'/include/commons/drape.php'; ?>
	<!--//커튼 데코레이션-->
	
	<!--컨텐츠-->
	<div id="content">
		<!--휘장-->
		<div class="keybox1"> </div>
		<!--//휘장-->
		
		<p class="key_visual"><img src="/images/sub/mypage/mypage_visual.png" alt="마이페이지" /></p>

		<!--왼쪽 컨텐츠-->
		<div class="assistant">
			<!--왼쪽 메뉴-->
			<? include_once $_SERVER['DOCUMENT_ROOT'].'/include/commons/inc_lnb.php'; ?>
			<!--// 왼쪽 메뉴-->

			<!--추천테마-->
			<? include_once $_SERVER['DOCUMENT_ROOT'].'/include/static/theme2.php'; ?>
			<!--//추천테마-->

			<!--오늘의 추천! 무료운세
			<--? include_once $_SERVER['DOCUMENT_ROOT'].'/include/static/free.php'; ?-->
			<!--//오늘의 추천! 무료운세-->
			
			<!--후기게시판
            <div class="side">
				<--?php echo $INC_POSTSCRIPT_LIST ?>
            </div>-->
			<!--//후기게시판-->

			<!--회원배너
			<--? include_once $_SERVER['DOCUMENT_ROOT'].'/include/static/member_join.php'; ?-->
			<!--//회원배너-->

			<!--고객센터-->
			<? include_once $_SERVER['DOCUMENT_ROOT'].'/include/static/cs.php'; ?>
			<!--//고객센터_추가-->
		</div>
		<!--//왼쪽 컨텐츠-->

		<!-- 메인컨텐츠-->
		<div class="cont">
			<div class="mypage">
				<h3><Img src="/images/mypage/sstit_prev.gif" alt="내가본운세" /></h3>
				<div class="text">
					<ul>
						<li>운세의신에서 보았던 유료 서비스를 확인하실 수 있습니다.</li>
					</ul>
				</div>
				<div class="fortunelist">
					<table width="100%" summary="내가 본 운세결과내역" cellpadding="0" cellspacing="0" >
						<caption class="blind">
						내가 본 운세결과 내역
						</caption>
						<colgroup>
						<col width="15%" />
						<col width="*" />
						<col width="15%" />
						<col width="20%" />
						</colgroup>
						<thead>
							<tr>
							  
								<th scope="col" class="date">날짜</th>
								<th scope="col" class="tle">서비스명</th>
								<th scope="col" class="replay">다시보기</th>
								<th scope="col" class="del">삭제하기</th>
								<th scope="col" class="sns">공유하기</th>
							</tr>
						</thead>
						
						<tbody >
							<!--내가본운세리스트가있을경우-->
<?
	foreach ($list as $item) {
		$create_dt   = substr($item['create_dt'], 0,10);
		$target_date = str_replace("-", "", $create_dt);
		$limit_date  = date('Ymd',strtotime("-7 day",time()));
?>
							<tr>
								<td class="date"><?=substr($item['create_dt'], 0,10)?></td>
								<td class="tle"><?=$item['service_name']?></td>
								<td class="replay">
<?		if ($limit_date <= $target_date) { ?>
									<a href="javascript:;" onclick="openResultHtml('<?=$item['result_html_url']?>')"><img src="/images/mypage/bt_replay.png" alt="다시보기" /></a>
<?		} else { ?>
										&nbsp;
<?		} ?>
								</td>
								<td class="del"><a href="javascript:;" onclick="hideServiceHistory('<?=$item['idx']?>')"><img src="/images/mypage/bt_del.png" alt="삭제하기" /></a></td>
								<td class="sns">
									<a href="javascript:;" onclick="snsLinker('twitter', '<?=$item['service_name']?>', '<?=$item['result_html_url']?>')"><img src="/images/common/bt_tw.png" alt="트위터" /></a>
									<a href="javascript:;" onclick="snsLinker('facebook', '<?=$item['service_name']?>', '<?=$item['result_html_url']?>')"><img src="/images/common/bt_fb.png" alt="페이스북" /></a>
									<a href="javascript:;" onclick="snsLinker('me2day', '<?=$item['service_name']?>', '<?=$item['result_html_url']?>')"><img src="/images/common/bt_mt.png" alt="미투데이" /></a>
								</td>
							</tr>
<?	} ?>
							<!--//내가본운세리스트가있을경우-->
						
							<!--내가본운세리스트가없을경우-->
							<?	if (count($list) == 0) :?>
							<tr>
								<td colspan="4">운세 내역이 없습니다.</td>
							</tr>
							<?	endif ?>
						</tbody>
						<tfoot>
							<tr>
								<td colspan="6" class="bt_area"></td>
							</tr>
							<tr>
								<td colspan="6">
									<?	if (!empty($navi['prev_page_link'])) : ?>
										<a href="/<?=$navi['prev_page_link']?>" class="btn"><img src="/images/common/board/page_prev.png" alt="이전 페이지로" /></a> 
									<?	endif ?>
									
									<?	for ($i = 0; $i < count($navi['page_nums']); $i++) : ?>
									<?		if (!empty($navi['page_nums'][$i]['url'])) : ?>
												<a href="/<?=$navi['page_nums'][$i]['url']?>"><?=$navi['page_nums'][$i]['page_no']?></a>
									<?		else : ?>
												<a href="javascript:;" class="over"><?=$navi['page_nums'][$i]['page_no']?></a>
									<?		endif ?>
									<?	endfor ?>

									<?	if (!empty($navi['page_count'])) : ?>
										...<a href="/<?=$navi['page_count_link']?>"><?=$navi['page_count']?></a>
									<?	endif ?>

									<?	if (!empty($navi['next_page_link'])) : ?>
										<a href="/<?=$navi['next_page_link']?>" class="btn"><img src="/images/common/board/page_next.png" alt="다음 페이지로" /></a>
									<?	endif ?>
								</td>
							</tr>
						</tfoot>
					</table>
				</div><!--/fortunelist--> 
			</div><!--mypage-->
		</div>
		<!--// 메인컨텐츠-->
        <!--서비스배너-->
		<? include_once $_SERVER['DOCUMENT_ROOT'].'/include/static/bn_service.php'; ?>
		<!--//서비스배너-->
	</div>
	<!--컨텐츠-->

	<!-- Footer -->
	<? include_once $_SERVER['DOCUMENT_ROOT'].'/include/commons/main_footer.php'; ?>
	<!--// Footer -->
</div>
</body>
</html>